<template>
	<main-content
		:tableHeight.sync="tableHeight"
		:otherDependenComponents="otherDependenComponents"
	>
		<template slot="query">
			<el-form
				ref="form"
				:inline="true"
				:model="queryData"
				label-width="auto"
				class="flex-warp-container"
			>
				<el-form-item
					:label="`${$t('common.belong_merchant')}:`"
					class="flex-row-container"
					label-width="77px"
				>
					<merchant-select
						v-model="queryData.merchantId"
						:merchantInfo.sync="merchantObj"
					></merchant-select>
				</el-form-item>
				<el-form-item>
					<el-select
						v-model="timeFlag"
						:placeholder="$t('common.please_choose')"
						style="width:150px"
					>
						<el-option
							:label="
								$t(
									'funds.proxy_member_funds_record.arrive_time'
								)
							"
							value="0"
						></el-option>
						<el-option
							:label="$t('funds.apply_time')"
							value="1"
						></el-option>
					</el-select>
					<el-date-picker
						v-model="searchTime"
						size="medium"
						:picker-options="pickerShortcut2"
						format="yyyy-MM-dd HH:mm:ss"
						type="datetimerange"
						range-separator="-"
						:start-placeholder="$t('common.start_date')"
						:end-placeholder="$t('common.end_date')"
						align="right"
						:clearable="false"
						:default-time="defaultTime"
					></el-date-picker>
				</el-form-item>
				<!-- <el-form-item
						:label="`${$t('funds.user_name')}:`"
						class="flex-row-container"
						label-width="77px"
					>
						<el-input
							v-model="queryData.userName"
							clearable
							size="medium"
							v-input="{ name: 'num_alp' }"
							:placeholder="$t('common.please_enter')"
							:disabled="loading"
						></el-input>
					</el-form-item>
					<el-form-item
						:label="`${$t('funds.order_no')}:`"
						class="flex-row-container"
						label-width="61px"
					>
						<el-input
							v-model="queryData.eventId"
							clearable
							size="medium"
							v-input="{ name: 'num_alp' }"
							:placeholder="$t('common.please_enter')"
							:disabled="loading"
						></el-input>
					</el-form-item> -->
				<!-- <el-form-item class="flex-row-container">
					<el-select
						v-model="queryData.inputType"
						:placeholder="$t('common.please_choose')"
						style="width:130px"
					>
						<el-option
							:label="$t('funds.user_name')"
							:value="1"
						></el-option>
						<el-option
							:label="
								$t('funds.proxy_member_funds_record.real_name')
							"
							:value="3"
						/>
					</el-select>
					<el-input
						v-model="queryData.inputValue"
						class="input-with-select"
						:placeholder="$t('common.please_enter')"
						clearable
						size="medium"
						v-input="{ name: 'noEmpty' }"
						style="width:200px"
					></el-input>
				</el-form-item> -->
				<el-form-item
					:label="`${$t('funds.user_name')}:`"
					class="flex-row-container"
					label-width="77px"
				>
					<el-input
						v-model="queryData.inputValue"
						class="input-with-select"
						:placeholder="$t('common.please_enter')"
						clearable
						size="medium"
						v-input="{ name: 'noEmpty' }"
						style="width:200px"
					></el-input>
				</el-form-item>

				<el-form-item
					:label="`${$t('funds.order_no')}:`"
					class="flex-row-container"
					label-width="61px"
				>
					<el-input
						v-model="queryData.eventId"
						clearable
						size="medium"
						:placeholder="$t('common.please_enter')"
						:disabled="loading"
						v-input="{ name: 'num_alp' }"
					></el-input>
				</el-form-item>
				<el-form-item
					:label="
						`${$t('funds.proxy_member_funds_record.app_type')}:`
					"
					class="flex-row-container"
					label-width="77px"
				>
					<el-select
						v-model="queryData.appType"
						clearable
						:placeholder="$t('common.select_all')"
						:popper-append-to-body="false"
					>
						<el-option
							v-for="item in loginDeviceTypeList"
							:key="item.code"
							:label="item.description"
							:value="item.code"
						></el-option>
					</el-select>
				</el-form-item>
				<el-form-item
					:label="
						`${$t('funds.proxy_member_funds_record.order_status')}:`
					"
					class="flex-row-container"
					label-width="77px"
				>
					<el-select
						v-model="queryData.orderStatus"
						clearable
						:placeholder="$t('common.select_all')"
						:popper-append-to-body="false"
					>
						<el-option
							v-for="item in depositClientStatus"
							:key="item.code"
							:label="item.description"
							:value="item.code"
						></el-option>
					</el-select>
				</el-form-item>
				<el-form-item
					:label="
						`${$t('funds.proxy_member_funds_record.client_state')}:`
					"
					class="flex-row-container"
					label-width="91px"
				>
					<el-select
						v-model="queryData.clientStatus"
						clearable
						:placeholder="$t('common.select_all')"
						:popper-append-to-body="false"
					>
						<el-option
							v-for="item in depositOrderStatus"
							:key="item.code"
							:label="item.description"
							:value="item.code"
						></el-option>
					</el-select>
				</el-form-item>
				<el-form-item
					:label="
						`${$t(
							'funds.thirdPeymentChannelConfig.payment_merchant_name'
						)}:`
					"
					class="flex-row-container"
					label-width="77px"
				>
					<el-input
						v-model="queryData.payMerchantName"
						clearable
						size="medium"
						:placeholder="$t('common.please_enter')"
						v-input="{ name: 'noEmpty' }"
					></el-input>
				</el-form-item>
				<el-form-item
					:label="`${$t('funds.pay_type')}:`"
					class="flex-row-container"
					label-width="77px"
				>
					<el-select
						v-model="queryData.payType"
						:popper-append-to-body="false"
						clearable
						:placeholder="$t('common.select_all')"
					>
						<el-option
							v-for="item in payTypeList"
							:key="item.code"
							:label="item.description"
							:value="item.code"
						></el-option>
					</el-select>
				</el-form-item>
				<!-- <el-form-item
						:label="`${$t('funds.proxy_member_funds_record.pay_type')}:`"
					>
						<el-select
							v-model="queryData.subPayType"
							clearable
							:placeholder="$t('common.select_all')"
							:popper-append-to-body="false"
						>
							<el-option
								v-for="item in paymentChannelType"
								:key="item.code"
								:label="item.description"
								:value="item.code"
							></el-option>
						</el-select>
					</el-form-item> -->
				<!-- <el-form-item :label="`${$t('funds.vip_level')}:`">
						<el-input-number
							v-model="queryData.vipLevelMin"
							size="medium"
							:placeholder="$t('common.minimum')"
							:min="0"
							:max="10"
							:controls="false"
							style="width:100px"
							name="vipLevelMin"
							@blur="
								handleAmount(
									queryData,
									1,
									'vipLevelMin',
									'vipLevelMax',
									$t(
										'funds.proxy_member_funds_record.form_search_tip1'
									)
								)
							"
						/>
						-
						<el-input-number
							v-model="queryData.vipLevelMax"
							size="medium"
							:placeholder="$t('common.maximum')"
							:min="0"
							:max="10"
							:controls="false"
							style="width:100px"
							name="vipLevelMax"
							@blur="
								handleAmount(
									queryData,
									2,
									'vipLevelMin',
									'vipLevelMax',
									$t(
										'funds.proxy_member_funds_record.form_search_tip2'
									)
								)
							"
						/>
					</el-form-item>
					<el-form-item
						:label="
							`${$t(
								'funds.proxy_member_funds_record.deposit_ip'
							)}:`
						"
					>
						<el-input
							v-model="queryData.ip"
							clearable
							size="medium"
							:placeholder="$t('common.please_enter')"
							:disabled="loading"
							@keyup.enter.native="enterSearch"
						></el-input>
					</el-form-item> -->
				<!-- <el-form-item
						:label="
							`${$t(
								'funds.proxy_member_funds_record.real_name'
							)}:`
						"
						class="flex-row-container"
						label-width="91px"
					>
						<el-input
							v-model="queryData.realName"
							clearable
							size="medium"
							v-input="{ name: 'noEmpty' }"
							:placeholder="$t('common.please_enter')"
							:disabled="loading"
						></el-input>
					</el-form-item> -->
				<el-form-item
					:label="`${$t('funds.channel_name')}:`"
					class="flex-row-container"
					label-width="77px"
				>
					<el-input
						v-model="queryData.channelName"
						clearable
						size="medium"
						:placeholder="$t('common.please_enter')"
						v-input="{ name: 'noEmpty' }"
					></el-input>
				</el-form-item>
				<el-form-item
					:label="`${$t('member.currency')}:`"
					class="flex-row-container"
					label-width="77px"
				>
					<el-select
						v-model="queryData.currency"
						clearable
						:placeholder="$t('common.select_all')"
						:popper-append-to-body="false"
					>
						<el-option
							v-for="item in currencyType"
							:key="item.code"
							:label="item.description"
							:value="item.code"
						></el-option>
					</el-select>
				</el-form-item>
				<el-form-item style="margin-left: 8px">
					<el-button
						type="primary"
						icon="el-icon-search"
						:disabled="loading"
						:loading="loading"
						size="medium"
						@click="search"
					>
						{{ $t('common.search') }}
					</el-button>
					<el-button
						icon="el-icon-refresh-left"
						:disabled="loading"
						size="medium"
						@click="reset"
					>
						{{ $t('common.reset') }}
					</el-button>
					<el-button
						v-if="hasPermission('404021')"
						icon="el-icon-download"
						type="warning"
						:loading="exportBtnLoading"
						:disabled="exportBtnLoading"
						size="medium"
						@click="handleExportExcel"
					>
						{{ $t('common.export') }}
					</el-button>
					<el-button
						type="success"
						icon="el-icon-sort"
						:disabled="loading"
						size="medium"
						@click="openColSettings"
					>
						{{ $t('common.row_set') }}
					</el-button>
				</el-form-item>
			</el-form>
		</template>
		<template slot="content">
			<el-table
				border
				size="mini"
				:data="tableData"
				style="width: 100%"
				:max-height="tableHeight"
				show-summary
				highlight-current-row
				class="small-size-table"
				:header-cell-style="getRowClass"
				:summary-method="(val) => handleRow(val, subSummary)"
			>
				<el-table-column
					prop="eventId"
					align="center"
					min-width="280"
					:label="$t('funds.order_no')"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<Copy
							v-if="!!scope.row.eventId"
							:title="scope.row.eventId"
							:copy="copy"
						>
							{{ scope.row.eventId }}
						</Copy>
						<span v-else>-</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.fund_audit.connect_three_order_no')
						]
					"
					prop="thirdOrderNo"
					align="center"
					min-width="260"
					:label="$t('funds.fund_audit.connect_three_order_no')"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<Copy
							v-if="!!scope.row.thirdOrderNo"
							:title="scope.row.thirdOrderNo"
							:copy="copy"
						>
							{{ scope.row.thirdOrderNo }}
						</Copy>
						<span v-else>-</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[$t('funds.user_name')]"
					prop="userName"
					align="center"
					:label="$t('funds.user_name')"
					min-width="150"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<Copy
							v-if="!!scope.row.userName"
							:title="scope.row.userName"
							:copy="copy"
						>
							{{ scope.row.userName }}
						</Copy>
						<span v-else>-</span>
					</template>
				</el-table-column>
				<!-- <el-table-column
					v-if="
						tableColumnData[
							$t('funds.proxy_member_funds_record.real_name')
						]
					"
					prop="realName"
					align="center"
					:label="$t('funds.proxy_member_funds_record.real_name')"
					min-width="150"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<Copy
							v-if="!!scope.row.realName"
							:title="scope.row.realName"
							:copy="copy"
						>
							{{ scope.row.realName }}
						</Copy>
						<span v-else>-</span>
					</template>
				</el-table-column> -->
				<el-table-column
					v-if="tableColumnData[$t('common.belong_merchant')]"
					prop="merchantName"
					align="center"
					:label="$t('common.belong_merchant')"
					min-width="150"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.merchantName || '-' }}
					</template>
				</el-table-column>
				<!-- <el-table-column
						prop="vipLevel"
						align="center"
						:label="$t('funds.vip_level')"
						min-width="150"
					>
						<template slot-scope="scope">
							VIP{{ scope.row.vipLevel }}
						</template>
					</el-table-column> -->
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.proxy_member_funds_record.app_type')
						]
					"
					prop="appTypeStr"
					align="center"
					:label="$t('funds.proxy_member_funds_record.app_type')"
					min-width="150"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.appTypeStr || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.proxy_member_funds_record.order_status')
						]
					"
					prop="orderStatusStr"
					align="center"
					:label="$t('funds.proxy_member_funds_record.order_status')"
					min-width="150"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.orderStatusStr || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.proxy_member_funds_record.client_state')
						]
					"
					prop="clientStatusStr"
					align="center"
					:label="$t('funds.proxy_member_funds_record.client_state')"
					min-width="150"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.clientStatusStr || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.proxy_member_funds_record.deposit_ip')
						]
					"
					prop="ip"
					align="center"
					min-width="150"
					show-overflow-tooltip
				>
					<template slot="header">
						{{ $t('funds.proxy_member_funds_record.deposit_ip') }}
						<br />
						{{ $t('funds.wind_control_level') }}
					</template>
					<template slot-scope="scope">
						<span>{{ scope.row.ip }}</span>
						<br />
						<span class="redColor">
							{{ $t('funds.wind_control_level') }}：{{
								scope.row.ipWindControl
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.proxy_member_funds_record.device_no')
						]
					"
					prop="deviceNo"
					align="center"
					min-width="150"
					show-overflow-tooltip
				>
					<template slot="header">
						{{ $t('funds.proxy_member_funds_record.device_no') }}
						<br />
						{{ $t('funds.wind_control_level') }}
					</template>
					<template slot-scope="scope">
						<span>{{ scope.row.deviceNo }}</span>
						<br />
						<span class="redColor">
							{{ $t('funds.wind_control_level') }}：{{
								scope.row.deviceNoWindControl
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t(
								'funds.thirdPeymentChannelConfig.payment_merchant_name'
							)
						]
					"
					prop="paymentMerchantName"
					align="center"
					:label="
						$t(
							'funds.thirdPeymentChannelConfig.payment_merchant_name'
						)
					"
					min-width="130"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.payMerchantName || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[$t('funds.pay_type')]"
					prop="payType"
					align="center"
					:label="$t('funds.pay_type')"
					min-width="130"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.payTypeStr || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[$t('funds.fund_audit.pay_currency')]"
					prop="currency"
					align="center"
					:label="$t('funds.fund_audit.pay_currency')"
					min-width="130"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.currency || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[$t('funds.channel_name')]"
					prop="channelName"
					align="center"
					:label="$t('funds.channel_name')"
					min-width="130"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.channelName || '-' }}
					</template>
				</el-table-column>
				<!-- <el-table-column
						prop="subPayTypeStr"
						align="center"
						min-width="150"
						:label="$t('funds.proxy_member_funds_record.pay_type')"
					></el-table-column> -->
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.fund_audit.order_save_money_usdt')
						]
					"
					prop="orderAmountUsdt"
					align="center"
					min-width="200"
					:label="$t('funds.fund_audit.order_save_money_usdt')"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<span>
							{{
								handleNumber(
									scope.row.symbolUsdt,
									scope.row.orderAmountUsdt
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.fund_audit.order_save_money_cny')
						]
					"
					prop="orderAmountCny"
					align="center"
					min-width="200"
					:label="$t('funds.fund_audit.order_save_money_cny')"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<span>
							{{
								handleNumber(
									scope.row.symbolCny,
									scope.row.orderAmountCny
								)
							}}
						</span>
					</template>
				</el-table-column>
				<!-- <el-table-column
						prop="realAmount"
						align="center"
						min-width="200"
						:label="
							$t('funds.proxy_member_funds_record.real_amount')
						"
						show-overflow-tooltip
					>
						<template slot-scope="scope">
							{{ handleCurrency(scope.row.currency) }}
							{{
								handleNumber(
									scope.row.currency,
									scope.row.realAmount
								)
							}}
						</template>
					</el-table-column> -->
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.fund_audit.real_record_money_usdt')
						]
					"
					prop="realAmountUsdt"
					align="center"
					min-width="200"
					:label="$t('funds.fund_audit.real_record_money_usdt')"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<span>
							{{
								handleNumber(
									scope.row.symbolUsdt,
									scope.row.realAmountUsdt
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.fund_audit.real_record_money_cny')
						]
					"
					prop="realAmountCny"
					align="center"
					min-width="200"
					:label="$t('funds.fund_audit.real_record_money_cny')"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<span>
							{{
								handleNumber(
									scope.row.symbolCny,
									scope.row.realAmountCny
								)
							}}
						</span>
					</template>
				</el-table-column>
				<!-- <el-table-column
						prop="creditLevel"
						align="center"
						min-width="150"
						:label="$t('funds.credit_level')"
						show-overflow-tooltip
					>
						<template slot-scope="scope">
							{{ scope.row.creditLevel }}
						</template>
					</el-table-column> -->
				<el-table-column
					v-if="tableColumnData[$t('funds.apply_time')]"
					prop="eventTime"
					align="center"
					:label="$t('funds.apply_time')"
					min-width="160"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.eventTime || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.proxy_member_funds_record.arrive_time')
						]
					"
					prop="payTime"
					align="center"
					:label="$t('funds.proxy_member_funds_record.arrive_time')"
					min-width="160"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.payTime || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[$t('common.remark')]"
					prop="remark"
					align="center"
					:label="$t('common.remark')"
					min-width="200"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.remark || '-' }}
					</template>
				</el-table-column>
				<!-- <el-table-column
					v-if="
						tableColumnData[
							$t('funds.fund_audit.third_bussiness_code')
						]
					"
					prop="thirdRespCode"
					align="center"
					:label="$t('funds.fund_audit.third_bussiness_code')"
					min-width="200"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.thirdRespCode || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="
						tableColumnData[
							$t('funds.fund_audit.third_bussiness_desc')
						]
					"
					prop="thirdRespContent"
					align="center"
					:label="$t('funds.fund_audit.third_bussiness_desc')"
					min-width="200"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.thirdRespContent || '-' }}
					</template>
				</el-table-column> -->
			</el-table>
			<!-- 分页 -->
			<el-pagination
				:current-page.sync="pageNum"
				class="pageValue"
				background
				layout="total, sizes,prev, pager, next, jumper"
				:page-size="pageSize"
				:page-sizes="pageSizes"
				:total="total"
				:pager-count="9"
				@current-change="handleCurrentChange"
				@size-change="handleSizeChange"
			></el-pagination>
		</template>
		<el-dialog
			:title="$t('common.row_set')"
			center
			:visible.sync="colSettings.visible"
			width="475px"
			class="setting-div"
		>
			<div>
				<el-link type="primary" class="mb15" @click="clickDel">
					复原缺省
				</el-link>
			</div>
			<div
				v-for="(value, name1) in activityListField"
				:key="name1"
				class="setting-div"
			>
				<el-checkbox v-model="dialogColumnData[name1]">
					{{ name1 }}
				</el-checkbox>
			</div>
			<div slot="footer" class="dialog-footer">
				<el-button @click="colSettings.visible = false">
					{{ $t('common.cancel') }}
				</el-button>
				<el-button type="primary" @click="handleOrderList">
					{{ $t('common.submit') }}
				</el-button>
			</div>
		</el-dialog>
	</main-content>
</template>

<script>
import list from '@/mixins/list'
import dayjs from 'dayjs'
import { routerNames } from '@/utils/consts'
import summaryList from './components/summaryList'
import MainContent from '@/components/MainContent/index.vue'
const end = () => {
	return dayjs().endOf('day')
}
const start = () => {
	return dayjs().startOf('day')
}
export default {
	name: routerNames.memberDepositRecord,
	components: {
		MainContent
	},
	mixins: [list, summaryList],
	data() {
		return {
			tableHeight: 480,
			otherDependenComponents: [],
			queryData: { inputType: 1 },
			timeFlag: '0',
			searchTime: [start(), end()],
			appTypeList: [],
			tableData: [],
			subSummary: {},
			merchantObj: '',
			paymentChannelType: [],
			exportBtnLoading: false,
			loading: true,
			colSettings: {
				visible: false,
				dialogColumnData: {}
			},
			activityListField: {
				[this.$t('funds.fund_audit.connect_three_order_no')]: true,
				[this.$t('funds.user_name')]: true,
				[this.$t('funds.proxy_member_funds_record.real_name')]: true,
				[this.$t('common.belong_merchant')]: true,
				[this.$t('funds.proxy_member_funds_record.app_type')]: true,
				[this.$t('funds.proxy_member_funds_record.order_status')]: true,
				[this.$t('funds.proxy_member_funds_record.client_state')]: true,
				[this.$t('funds.proxy_member_funds_record.deposit_ip')]: true,
				[this.$t('funds.proxy_member_funds_record.device_no')]: true,
				[this.$t(
					'funds.thirdPeymentChannelConfig.payment_merchant_name'
				)]: true,
				[this.$t('funds.pay_type')]: true,
				[this.$t('funds.fund_audit.pay_currency')]: true,
				[this.$t('funds.channel_name')]: true,
				[this.$t('funds.fund_audit.order_save_money_usdt')]: true,
				[this.$t('funds.fund_audit.order_save_money_cny')]: true,
				[this.$t('funds.fund_audit.real_record_money_usdt')]: true,
				[this.$t('funds.fund_audit.real_record_money_cny')]: true,
				[this.$t('funds.apply_time')]: true,
				[this.$t('funds.proxy_member_funds_record.arrive_time')]: true,
				[this.$t('common.remark')]: true,
				[this.$t('funds.fund_audit.third_bussiness_code')]: true,
				[this.$t('funds.fund_audit.third_bussiness_desc')]: true
			}
		}
	},
	computed: {
		payTypeList() {
			return this.globalDics.depositMemberPaymentType || []
		},
		depositOrderStatus() {
			return this.globalDics.depositOrderStatus || []
		},
		loginDeviceTypeList() {
			return this.globalDics.login_device_type1 || []
		},
		depositClientStatus() {
			return this.globalDics.depositClientStatus || []
		},
		currencyType() {
			return this.globalDics.currencyType || []
		}
	},
	watch: {
		timeFlag: {
			handler(newVal) {
				this.tableData = []
				this.total = 0
			}
		}
	},
	created() {
		this.initIndexDB('memberDepositRecord', this.activityListField)
		this.getPaymentChannelTypeChange()
	},
	methods: {
		cleanBlankSpace(key, key1) {
			if (this[key][key1]) {
				this[key][key1] = (this[key][key1] + '').replace(/\s+/g, '')
			}
		},
		getSearchParams() {
			const timeArr = this.searchTime || []
			const params = {
				...this.queryData,
				payTimeStart:
					this.timeFlag === '0'
						? dayjs(timeArr[0]).format('YYYY-MM-DD HH:mm:ss')
						: undefined,
				payTimeEnd:
					this.timeFlag === '0'
						? dayjs(timeArr[1]).format('YYYY-MM-DD HH:mm:ss')
						: undefined,
				eventTimeStart:
					this.timeFlag === '1'
						? dayjs(timeArr[0]).format('YYYY-MM-DD HH:mm:ss')
						: undefined,
				eventTimeEnd:
					this.timeFlag === '1'
						? dayjs(timeArr[1]).format('YYYY-MM-DD HH:mm:ss')
						: undefined
			}
			params.userName = undefined
			params.realName = undefined
			if (params.inputType === 1) {
				params.userName = params.inputValue || undefined
			} else if (params.inputType === 3) {
				params.realName = params.inputValue || undefined
			}
			delete params.inputValue
			delete params.inputType
			return params
		},
		loadData() {
			this.loading = true
			let params = this.getSearchParams()
			params = this.getParams(params)
			this.pageCurrency = this.merchantObj?.currency || ''
			this.$api
				.getMemberDepositRecordList(params)
				.then((res) => {
					const { record, totalRecord, summary } = res.data || {}
					this.tableData = record || []
					this.total = totalRecord || 0
					this.subSummary = summary || {}

					this.loading = false
				})
				.catch(() => {
					this.loading = false
				})
		},
		getPaymentChannelTypeChange() {
			this.$api.triggerDepositChannel(0).then((res) => {
				this.paymentChannelType = res.data
			})
		},
		reset() {
			this.pageNum = 1
			this.queryData = { inputType: 1 }
			this.timeFlag = '0'
			this.merchantObj = ''
			this.searchTime = [start(), end()]
			this.loadData()
		},
		reloadTime() {
			this.searchTime = [start(), end()]
		},
		handleExportExcel() {
			const params = this.getSearchParams()
			this.exportBtnLoading = true
			this.exportExcelPublic({
				api: 'getMemberDepositRecordExport',
				params
			}).finally(() => {
				this.exportBtnLoading = false
			})
		},
		// 提交列设置数据
		handleOrderList() {
			this.colSettings.visible = false
			this.updateIndexDB()
		},
		// 打开列设置弹框
		openColSettings() {
			this.getIndexDB(this.activityListField)
			this.colSettings.visible = true
		},
		clickDel() {
			const activityListColumn = {}
			Object.keys(this.activityListField).forEach((item) => {
				activityListColumn[item] = true
			})
			this.dialogColumnData = Object.assign({}, activityListColumn)
		}
	}
}
</script>

<style lang="scss" scoped>
::v-deep .el-table__fixed-footer-wrapper .cell,
::v-deep .el-table__footer-wrapper .cell {
	height: 100%;
	padding: 0 !important;
	margin: 0 !important;
	> div {
		height: 100%;
	}
}
::v-deep .footer_count_row {
	min-height: 50px;
	height: 50%;
	display: flex;
	font-weight: 700;
	padding: 5px 0;
	align-items: center;
	flex-direction: column;
	justify-content: center;
}
::v-deep .footer_count_row_border {
	border-top: 1px solid #ebeef5;
}
</style>
